# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-dict2xml
pkgname=('python2-dict2xml' 'python-dict2xml')
_pkgname=dict2xml
pkgver=1.7.7
pkgrel=1
pkgdesc='Super Simple utility to convert a python dictionary into an xml string.'
arch=('any')
url='https://pypi.org/project/dict2xml/#files'
license=('GPL2')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8605754b20833990d07906ce98cd477de58cad8d826a5851d84e1402e9f4f6bcc073631920fb73e5253de7d7eafa22c8b92d3ba5875ee852b719204f92e8fb93')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-dict2xml() {
  depends=('python2' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-dict2xml() {
  depends=('python' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

